package com.kaizzi.data.jdl.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kaizzi.data.common.been.TempBeen;
import com.kaizzi.data.jdl.entity.TeamList;
import com.kaizzi.data.jdl.mapper.TeamListMapper;
import com.kaizzi.data.jdl.service.JdlNumService;
import com.kaizzi.data.jdl.service.TeamListService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Kzen
 * @Description description
 * @date 2020/9/16
 */
@Component
public class TeamListServiceImpl extends ServiceImpl<TeamListMapper, TeamList> implements TeamListService {

    @Resource
    private TeamListMapper teamListMapper;
    @Resource
    private JdlNumService jdlNumService;

    @Override
    @DS("jdl_view")
    public List<TempBeen> getTeatArea(String startDate, String endDate) {
        return teamListMapper.getTeamArea(startDate,endDate);
    }

    @Override
    @DS("jdl_view")
    public long getTeamArea4(String startDate, String endDate) {
        Long teamArea4 = teamListMapper.getTeamArea4(startDate, endDate);
        return jdlNumService.transNum(teamArea4);
    }

    @Override
    @DS("jdl_view")
    public List<TempBeen> getYtdTeamSportType(String startDate, String endDate) {
        return teamListMapper.getYtdTeamSportType(startDate,endDate);
    }

    @Override
    @DS("jdl_view")
    public List<TempBeen> getYtdTeamFrequency(String startDate, String endDate) {
        return teamListMapper.getYtdTeamFrequency(startDate,endDate);
    }

    @Override
    @DS("jdl_view")
    public List<TempBeen> getYtdTeamFrequency2(String startDate, String endDate) {
        return teamListMapper.getYtdTeamFrequency2(startDate,endDate);
    }

    @Override
    @DS("jdl_view")
    public List<TempBeen> getYtdTypeCount(String startDate, String endDate) {
        return teamListMapper.getYtdTypeCount(startDate,endDate);
    }

    @Override
    @DS("jdl_view")
    public List<TempBeen> getTeamSuccessCount(String startDate, String endDate) {
        return teamListMapper.getTeamSuccessCount(startDate,endDate);
    }

    @Override
    @DS("jdl_view")
    public List<TempBeen> getTeamFailCount(String startDate, String endDate) {
        return teamListMapper.getTeamFailCount(startDate,endDate);
    }
}
